<%@page import="com.bill.common.utils.TranType"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DecimalFormat"%>
<%@page import="com.bill.common.system.dto.TransactionRecordDTO"%>
<%@page
	import="com.bill.common.system.service.ITransactionRecordService"%>
<%@page import="com.bill.common.user.dto.AccountDTO"%>
<%@page import="com.bill.common.user.service.IAccountService"%>
<%@page import="com.bill.common.news.dto.NewsContentDTO"%>
<%@page import="com.sinba.common.dto.PageDTO"%>
<%@page import="com.bill.common.news.dto.NewsQueryDTO"%>
<%@page import="com.bill.common.news.service.INewsService"%>
<%@page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
//获取当前浏览器语言做为默认的语言版本start
request.setAttribute("lang_defaultLanguage","zh_CN");
//request.setAttribute("lang_defaultLanguage","en_US");
//获取当前浏览器语言做为默认的语言版本end
String path = request.getContextPath() + "/" ;
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()	+ path ;
request.setAttribute("basePath", basePath);
%> 
<fmt:setLocale value="${empty cookie['language'].value?lang_defaultLanguage:cookie['language'].value}"/>
<fmt:setBundle basename="i18n.itilbase"/>
<c:set var="lang" scope="session" value="${empty cookie['language'].value?lang_defaultLanguage:cookie['language'].value}" />

<%
	if (session.getAttribute("loginName") == null) {
		response.sendRedirect("login.jsp");
		return;
	}
	ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	INewsService ns = (INewsService) ac.getBean("newsService");
	NewsQueryDTO queryDTO = new NewsQueryDTO();
	queryDTO.setNewType("WebAffiche");
	queryDTO.setLimit(6);
	PageDTO pagedto = ns.findNewsByCategory(queryDTO);

	NewsContentDTO content = ns
			.findTop1NewsByCategory(new NewsQueryDTO(null, null, null, null, null, "WebAffiche"));

	request.setAttribute("pagedto", pagedto);
	request.setAttribute("content", content);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh">
<head>
	<title><fmt:message key="i18n.userCenter" />-<fmt:message key="i18n.title" /></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="shortcut icon" href="../images/favicon.png" />
	
	<!-- bootstrap -->
    <link href="css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- libraries -->
    <link href="css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
    <link href="css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="css/layout.css" />
    <link rel="stylesheet" type="text/css" href="css/elements.css" />
    <link rel="stylesheet" type="text/css" href="css/icons.css" />

    <!-- this page specific styles -->
    <link rel="stylesheet" href="css/compiled/index.css" type="text/css" media="screen" />    
    
	
	<script type="text/javascript" src="../scripts/jquery-1.11.0.min.js"></script>
	<script type="text/javascript" src="../scripts/script.js"></script>
	<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
	<script type="text/javascript">
		function logout() {
			if (confirm("确定退出吗?")) {
				window.top.location.href = 'logout.jsp';
			}
		}
		function setCookie(c_name, value, exdays) {
	
			var exdate = new Date();
			exdate.setDate(exdate.getDate() + exdays);
			var c_value = escape(value)
					+ ((exdays == null) ? "" : "; expires="
							+ exdate.toUTCString());
			document.cookie = c_name + "=" + c_value;
		}
		function setLanguage(lang) {
			setCookie('language', lang, 300);
			window.top.location.reload();
		}
		function mainrefresh() {
			document.getElementById("iframepage").contentWindow.location.reload(true);
		}
	</script>
		
</head>

<body>
	<%-- <div class="account">
		<jsp:include page="../page_head.jsp"></jsp:include>
	</div> --%>
	<!-- navbar -->
    <div class="navbar navbar-inverse">
        <div class="navbar-inner">
            <button type="button" class="btn btn-navbar visible-phone" id="menu-toggler">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            
            <a class="brand" href=""><img src="img/logo_${lang}.png" /></a>

            <ul class="nav pull-right">                
                <li class="settings hidden-phone">
                    <a href="javascript:mainrefresh();" role="button">
                        <i class="icon-refresh"></i>
                    </a>
                </li>
                
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle hidden-phone" data-toggle="dropdown">
                        <fmt:message key="i18n.lanauger" />
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                    	<li><a href="javascript:setLanguage('en_US');"><i class="flag-us"></i><fmt:message key="i18n.en" /></a></li>
                        <li><a href="javascript:setLanguage('zh_CN');"><i class="flag-cn"></i> <fmt:message key="i18n.zh" /></a></li>
                        <li><a href="javascript:setLanguage('zh_TW');"><i class="flag-cn"></i> <fmt:message key="i18n.tw" /></a></li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle hidden-phone" data-toggle="dropdown">
                        ${session.userName}
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="cp.jsp" target="main"><fmt:message key="i18n.updatePassword" /></a></li>
				        <li><a href="pi.jsp" target="main"><fmt:message key="i18n.updateUserInfo" /></a></li>
				        <li><a href="changeMobile.jsp" target="main"><fmt:message key="i18n.changeMobile" /></a></li>
                    </ul>
                </li>
                
                
                
                <li class="settings hidden-phone">
                    <a href="#" role="button">
                        <i class="icon-cog"></i>
                    </a>
                </li>
                <li class="settings hidden-phone">
                    <a href="javascript:logout();" role="button">
                        <i class="icon-share-alt"></i>
                    </a>
                </li>
            </ul>            
        </div>
    </div>
    <!-- end navbar -->

    <!-- sidebar -->
    <div id="sidebar-nav">
        <ul id="dashboard-menu">
            <li class="active">
                <div class="pointer">
                    <div class="arrow"></div>
                    <div class="arrow_border"></div>
                </div>
                <a href="index.jsp">
                    <i class="icon-home"></i>
                    <span><fmt:message key="i18n.firstPage" /></span>
                </a>
            </li>            
            <li>
                <a class="dropdown-toggle" href="#">
                    <i class="icon-group"></i>
                    <span><fmt:message key="i18n.gerenManage" /></span>
                    <i class="icon-chevron-down"></i>
                </a>
                <ul class="submenu">
                    <li><a href="cp.jsp" target="main"><fmt:message key="i18n.updatePassword" /></a></li>
			        <li><a href="pi.jsp" target="main"><fmt:message key="i18n.updateUserInfo" /></a></li>
			        <li><a href="changeMobile.jsp" target="main"><fmt:message key="i18n.changeMobile" /></a></li>
                </ul>
            </li>
            <li>
                <a class="dropdown-toggle" href="#">
                    <i class="icon-edit"></i>
                    <span><fmt:message key="i18n.yewuManage" /></span>
                    <i class="icon-chevron-down"></i>
                </a>
                <ul class="submenu">
                    <li><a href="recommend.jsp" target="main"><fmt:message key="i18n.myTuiJian" /></a></li>
                    <li><a href="xpTree.jsp" target="main"><fmt:message key="i18n.teamTreePicture" /></a></li>
					<li><a href="cashBusiness.jsp" target="main"><fmt:message key="i18n.acountTx" /></a></li>
					<li><a href="transfer.jsp" target="main"><fmt:message key="i18n.accountZhuanZhang" /></a></li>
					
                </ul>
            </li>
            <li>
                <a class="dropdown-toggle ui-elements" href="#">
                    <i class="icon-code-fork"></i>
                    <span><fmt:message key="detailQuery" /></span>
                    <i class="icon-chevron-down"></i>
                </a>
                <ul class="submenu">
                    <li><a href="accountDetails.jsp?dtype=<%=TranType.STATIC %>" target="main"><fmt:message key="<%=TranType.STATIC %>" /></a></li>
		        	<li><a href="accountDetails.jsp?dtype=<%=TranType.DYNAMIC %>" target="main"><fmt:message key="<%=TranType.DYNAMIC %>" /></a></li>
		        	<li><a href="accountDetails.jsp?dtype=<%=TranType.OTHER1 %>" target="main"><fmt:message key="<%=TranType.OTHER1 %>" /></a></li>
                </ul>
            </li>
            <li>
                <a class="dropdown-toggle" href="#">
                    <i class=icon-picture></i>
                    <span><fmt:message key="i18n.freeTrade" /></span>
                    <i class="icon-chevron-down"></i>
                </a>
                <ul class="submenu">
                	<li><a href="sellIng.jsp" target="main"><fmt:message key="i18n.jiaoyidating"/></a></li>
                    <li><a href="sell.jsp" target="main"><fmt:message key="i18n.mySells"/></a></li>
                    <li><a href="myBuy.jsp" target="main"><fmt:message key="i18n.myBuys" /></a></li>
                </ul>
            </li>
            <li>
                <a class="dropdown-toggle" href="#">
                    <i class="icon-edit"></i>
                    <span><fmt:message key="i18n.onlineCz" /></span>
                    <i class="icon-chevron-down"></i>
                </a>
                <ul class="submenu">
                    <li><a href="onlinecongzhi.jsp" target="main"><fmt:message key="rechargeLine" /></a></li>
                </ul>
            </li>
            
            <li>
                <a class="dropdown-toggle" href="#">
                    <i class=icon-calendar-empty></i>
                    <span><fmt:message key="i18n.xinxiManage" /></span>
                    <i class="icon-chevron-down"></i>
                </a>
                <ul class="submenu">
                    <li><a href="newsList.jsp?newType=WebAffiche" target="main"><fmt:message key="i18n.noticeBroad"/></a></li>
                    <li><a href="imessage.jsp" target="main"><fmt:message key="i18n.communStation" /></a></li>
                    
                </ul>
            </li>
            <li>
                <a href="javascript:logout();">
                    <i class="icon-share-alt"></i>
                    <span><fmt:message key="i18n.anquantuichu" /></span>
                </a>
            </li>
        </ul>
    </div>
    <!-- end sidebar -->


	<!-- main container -->
    <div class="content">
    	<iframe src="main.jsp" name="main" id="iframepage" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" onLoad="iFrameHeight()" style="width: 100%"></iframe>
		<!-- <iframe id="main" name="main" scrolling="auto" src="main.jsp" onload="dyniframesize('main')"
		frameborder=0 scrolling=yes
		style="margin-left: 0px; margin-top: 0px; width: 100%;min-height: 800px;"></iframe> -->
    </div>


	<!-- scripts -->
    <script src="js/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery-ui-1.10.2.custom.min.js"></script>
    <!-- knob -->
    <script src="js/jquery.knob.js"></script>
    <!-- flot charts -->
    <script src="js/jquery.flot.js"></script>
    <script src="js/jquery.flot.stack.js"></script>
    <script src="js/jquery.flot.resize.js"></script>
    <script src="js/theme.js"></script>
    <script type="text/javascript" language="javascript">   
	    function iFrameHeight() {   
	    var ifm= document.getElementById("iframepage");   
	    var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;   
	    if(ifm != null && subWeb != null) {
	       ifm.height = subWeb.body.scrollHeight;
	       ifm.width = subWeb.body.scrollWidth;
	    }   
	    }   
    </script>
    
</body>
</html>